package storage.files
{
	import flash.events.Event;
	import flash.events.IEventDispatcher;
	import flash.net.URLLoader;
	import flash.net.URLRequest;

	public class XMLFileReader implements IEventDispatcher
	{
		private var xmlData:XML;
		
		public function XMLFileReader()
		{
		}
		
		public function loadXML(String path):void {
			var xmlLoader:URLLoader = new URLLoader();
			xmlData = new XML();
			
			xmlLoader.addEventListener(Event.COMPLETE, eventOnComplete);
			xmlLoader.load(new URLRequest(path));
			
			function eventOnComplete(e:Event):void {
				xmlData = new XML(e.target.data);
			}
		}
	}
}